
package com.fly.datasyn.controller;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.fly.core.entity.AjaxObject;
import com.fly.datasyn.entity.Health;
import com.fly.datasyn.service.HealthService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "健康和业务数据接口")
@RestController
@RequestMapping("/health")
public class HealthController
{
    @Autowired
    private HealthService healthService;
    
    @ApiOperation("新增数据")
    @PostMapping("/create")
    public AjaxObject create(@Valid @RequestBody Health health)
    {
        healthService.saveOrUpdate(health);
        return AjaxObject.newOk("health数据添加成功！");
    }
}
